﻿using System;
using System.Text;
/**
日志
**/
namespace open_api_sdk_csharp.com.chinaums.open.api.internals.utils
{
    public class OpenApiLogger
    {
        private static bool needEnableLogger = true;
        //private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        public static void logInfo(String rsp)
        {
            DateTime dateTime = DateTime.Now;
            StringBuilder stringbuilder = new StringBuilder();
            stringbuilder.AppendLine(dateTime.ToString());
            stringbuilder.AppendLine("#");
            stringbuilder.AppendLine(rsp);
            //log.Info(stringbuilder.ToString());
        }
        public static void logError(String rsp)
        {
            if (!needEnableLogger)
            {
                return;
            }
            DateTime dateTime = DateTime.Now;
            StringBuilder stringbuilder = new StringBuilder();
            stringbuilder.AppendLine(dateTime.ToString());
            stringbuilder.AppendLine("#");
            stringbuilder.AppendLine(rsp);
            //log.Error(stringbuilder.ToString());
        }
        public static void logError(OpenApiException openApiException)
        {
            if (!needEnableLogger)
            {
                return;
            }
           // log.Error(openApiException.StackTrace);
        }
    }
}
